package com.example.demoboot.mdc;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.MDC;

import java.util.UUID;

public class TxMDC {
    private static final Logger LOGGER = LoggerFactory.getLogger(TxMDC.class);

    public static void main(String[] args) {
        LOGGER.info("main thread start");
        for (int i = 0; i < 5; i++) {
            new Thread(() -> {
                MDC.put("txId", UUID.randomUUID().toString());
                new TxFlow().run();
            }).start();
        }
    }
}